package com.example.demo.repository;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import com.example.demo.custom.BaseRepository;
import com.example.demo.entity.BanZu;
import com.example.demo.entity.SysUser;

@Repository
public interface SysUserRepository extends BaseRepository<SysUser, Integer>{

	public SysUser findByUsernameAndPassword(String username, String password);

	public SysUser findByUsername(String username);

	public List<SysUser> findByDeptId(Integer nameId);

	public List<SysUser> findByBanzu(BanZu banzu);
	
	@Query("select distinct t from SysUser t where t.dept.name=?1")
	public List<SysUser> findByDeptName(String name);

}
